import { anomalyPageApi } from '@/api/system/anomaly'
import { PageRequest } from '@/api/types'

export const useAnomalyApi = () => {
  // 获取日志管理列表
  const fetchAnomalyPage = async (pageRequest: PageRequest) => {
    try {
      const res = await anomalyPageApi({
        pageRequest
      })

      if (res.code === '0000') {
        console.log(res, 'res resres')
        return {
          data: res.data?.content,
          total: res.data?.total
        }
      }
    } catch (e) {
      console.log(e)
    }
  }

  return {
    fetchAnomalyPage
  }
}
